home *** CD-ROM | disk | FTP | other *** search
- /* INTDOS.C --- p. 631 */
- #ifdef EXAMPLE_1
- #include <stdio.h>
- #include <dos.h>
- #define DOS_GETDRIVE 0x19
- union REGS xr;
- main()
- {
- xr.h.ah = DOS_GETDRIVE;
- intdos(&xr,&xr);
- /* Adding 65 to the value gives us the drive letter */
- printf("Current drive: %c\n", xr.h.al+65);
- }
- #endif
- #include <stdio.h>
- #include <dos.h>
- #define DOS_GETTIME 0x2c
- main()
- {
- union REGS xr, yr;
- xr.h.ah = DOS_GETTIME;
- intdos(&xr, &yr);
- printf("Current time is %.2d:%.2d:%.2d\n",
- yr.h.ch, yr.h.cl, yr.h.dh);
- }